<?php
include '../../../php/conn.php'; 
//查询班级
if ($con) {
	
		$sql = "SELECT *
FROM classmanagement, departmenttable, grade, teachermanagement
WHERE classmanagement.gradeid = grade.gradeid
AND teachermanagement.TMid = classmanagement.TMid";
		//执行sql语句
		$rs = mysql_query($sql);
		//判断是否执行sql语句成功
		if ($rs) {
			//执行成功
			//计算查询出来的数据的总条数
			$num = mysql_num_rows($rs);
			if ($num >= 1) {

				while ($rows = mysql_fetch_assoc($rs)) {
					$arr[] = $rows;
				}
				//返回查询状态及查询数据
				echo '{"status":"200","msg":' . json_encode($arr) . '}';

			} else {
				//没有商品数据
				echo '{"status":"404"}';
			}
		} else {
			//执行失败
			echo '{"status":"500"}';
		}

	} else {
		//执行失败
		echo '{"status":"0"}';
	}


//关闭数据库
mysql_close($con);
?>